#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
int main()
{
	char arr[100] = { 0 };
	gets(arr);
	int len = strlen(arr);
	int i = 0;
	int count1 = 0;
	int count2 = 0;
	for (i = 0; i < len; i++)
	{
		if (arr[i] == 'A')
		{
			count1++;
		}
		if (arr[i] == 'B')
		{
			count2++;
		}
	}
	if (count1 > count2)
	{
		printf("A\n");
	}
	else if (count1 < count2)
	{
		printf("B\n");
	}
	else
		printf("E\n");
	return 0;
}